all keys via --all or in a bare repo.
(Introduced in version 8.20200720)
* vicfg: Include mincopies configuration.
+ * Improve handling of directory special remotes with importtree=yes whose
+ ignoreinode setting has been changed. When getting a file from such a
+ remote, accept the content that would have been accepted with the
+ previous ignoreinode setting.
-- Joey Hess <id@joeyh.name> Mon, 29 Aug 2022 15:03:04 -0400
then toInodeCache' noTSDelta f st 0
else toInodeCache noTSDelta f st
+-- Since ignoreinodes can be changed by enableremote, and since previous
+-- versions of git-annex ignored inodes by default, treat two content
+-- idenfiers as the same if they differ only by one having the inode
+-- ignored.
guardSameContentIdentifiers :: a -> ContentIdentifier -> Maybe ContentIdentifier -> a
-guardSameContentIdentifiers cont old new
- | new == Just old = cont
+guardSameContentIdentifiers _ _ Nothing = giveup "file not found"
+guardSameContentIdentifiers cont old (Just new)
+ | new == old = cont
+ | ignoreinode new == old = cont
+ | new == ignoreinode old = cont
| otherwise = giveup "file content has changed"
+ where
+ ignoreinode cid@(ContentIdentifier b) =
+ case readInodeCache (decodeBS b) of
+ Nothing -> cid
+ Just ic ->
+ let ic' = replaceInode 0 ic
+ in ContentIdentifier (encodeBS (showInodeCache ic'))
importKeyM :: IgnoreInodes -> RawFilePath -> ExportLocation -> ContentIdentifier -> ByteSize -> MeterUpdate -> Annex (Maybe Key)
importKeyM ii dir loc cid sz p = do
inodeCacheToMtime,
inodeCacheToEpochTime,
inodeCacheEpochTimeRange,
+ replaceInode,
SentinalFile(..),
SentinalStatus(..),
let t = inodeCacheToEpochTime i
in (t-1, t+1)
+replaceInode :: FileID -> InodeCache -> InodeCache
+replaceInode inode (InodeCache (InodeCachePrim _ sz mtime)) =
+ InodeCache (InodeCachePrim inode sz mtime)
+
{- For backwards compatability, support low-res mtime with no
- fractional seconds. -}
data MTime = MTimeLowRes EpochTime | MTimeHighRes POSIXTime
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2022-09-16T17:43:38Z"
+ content="""
+I've made the directory special remote treat content identifiers
+that differ only in one having the inode set to 0. Which will avoid it
+failing in the situation I showed.
+"""]]